#include <assert.h>

#include "TeacherManager.h"
#include "Store\TeacherGroupsTable.h"
#include "Store\TeachersTable.h"


namespace TCServer
{
	namespace Manager
	{
		TeacherManager* TeacherManager::_instance = nullptr;

		TeacherManager::TeacherManager()
		{
			assert(_instance == nullptr);
			// #TODO: initialize class

			_instance = this;
		}

		TeacherManager::~TeacherManager()
		{
			_instance = nullptr;
		}

		TCServer::Manager::TeacherManager* TeacherManager::instance()
		{
			if (_instance == nullptr)
				_instance = new TeacherManager;
			return _instance;
		}

		QList<QVariantMap> TeacherManager::queryGroups(quint64 idBegin, quint64 idEnd)
{
			return Store::TeacherGroupsTable::query(idBegin, idEnd);
		}

		QList<QVariantMap> TeacherManager::queryTeachers(quint64 groupId, quint64 idBegin, quint64 idEnd)
        {
			return Store::TeachersTable::query(groupId, idBegin, idEnd);
		}

	}
}

